package com.zhangfb95.crosschain.plugin.container.java.fabric2.infra.extend.fabricsupport;

import org.hyperledger.fabric.sdk.Enrollment;
import org.hyperledger.fabric.sdk.User;

import java.util.HashSet;
import java.util.Set;

/**
 * @author zhangfubing
 * @since 2023/7/5
 */
public class FabricUser implements User {

    private final String name;
    private final String mspId;
    private final Enrollment enrollment;

    public FabricUser(String name, String mspId, Enrollment enrollment) {
        this.name = name;
        this.mspId = mspId;
        this.enrollment = enrollment;
    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public Set<String> getRoles() {
        return new HashSet<>();
    }

    @Override
    public String getAccount() {
        return "";
    }

    @Override
    public String getAffiliation() {
        return "";
    }

    @Override
    public Enrollment getEnrollment() {
        return this.enrollment;
    }

    @Override
    public String getMspId() {
        return this.mspId;
    }
}
